//Figure8.c
#include <avr/io.h>
#include <util/delay.h>
int main (void)
{
	DDRD = 0xFF;
	PORTD = 0;
	for (int i = 1; i <= 10; i = i + 1)
	{
		_delay_loop_2(30000);
	}
	 
		
	for (int i = 1; i <= 700; i = i + 1)
	{
		PORTD = 3;				
		_delay_loop_2(1500);  //Notice Different values of the Delay loop
		PORTD = 1;
		_delay_loop_2(3600);  //This motor value makes it turn
	}
	PORTD = 0;
	for (int i =1; i <= 700; i = i + 1)
	{
		PORTD = 3;
		_delay_loop_2(1500);
		PORTD = 2;
		_delay_loop_2(3600);  //This motor value makes it break and turn the opposite way
	}
	PORTD = 0;		//Motors Stop and so does program no loop
}

